#include <algorithm>
#include <cstdio>

const int N = 300005;
unsigned int n, p[900005], h[900005];
double ans;
int e1[900005], e2[900005], stk[900005], top;

struct Node {
  unsigned int p, h;
} a[N];

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("testdata.in", "r", stdin);
  freopen("testdata.out", "w", stdout);
#else
  freopen("dinosaur.in", "r", stdin);
  freopen("dinosaur.out", "w", stdout);
#endif
#endif

  scanf("%d", &n);
  for (unsigned int i = 1; i <= n; ++i) {
    scanf("%u%u", &a[i].p, &a[i].h);
    p[i] = a[i].p;
  }
  *p = n;
  for (unsigned int i = 1; i <= n; ++i) {
    if (a[i].h > a[i].p) return puts("-1"), 0;
    p[++*p] = a[i].p - a[i].h;
    p[++*p] = a[i].p + a[i].h;
  }
  std::sort(p + 1, p + *p + 1);
  *p = std::unique(p + 1, p + *p + 1) - p - 1;
  for (unsigned int i = 1, pos; i <= n; ++i) {
    pos = std::lower_bound(p + 1, p + *p + 1, a[i].p) - p;
    h[pos] = std::max(h[pos], a[i].h);
  }
  for (unsigned int i = 1; i <= *p; ++i) {
    if (h[i] != 0)
      e1[std::lower_bound(p + 1, p + *p + 1, p[i] - h[i]) - p]++,
          e2[std::lower_bound(p + 1, p + *p + 1, p[i] + h[i]) - p]++;
  }
  for (unsigned int i = 1; i <= *p; ++i) {
    while (e2[i]) {
      e2[i]--;
      if (top == 1) { ans = std::max(ans, (p[i] - p[stk[top]]) / 2.0); }
      top--;
    }
    while (e1[i]) stk[++top] = i, e1[i]--;
  }
  printf("%.1lf", ans);
  return 0;
}